// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import store from './store/index'
import router from './router'
import FastClick from 'fastclick'
import Vant from 'vant'
import 'vant/lib/index.css'
import VueCookies from 'vue-cookies'
import VueLazyLoad from 'vue-lazyload'
import error from '@/assets/lazy/error.png'
import loading from '@/assets/lazy/loading.gif'
import utils from './utils/index'
import global from './utils/global'
import validate from './utils/validate'
import './utils/permession'
import '../static/css/global.css'
import 'font-awesome/css/font-awesome.min.css'
Vue.use(Vant)
Vue.use(VueCookies)
Vue.use(VueLazyLoad, {
  attempt: 1, // 只请求一次
  error: error, // 错误图片默认图
  loading: loading, // 加载中默认图
  filter: {
    // 通过这个方法可以对我们的图片资源路径进行修改
    webp (listener, options) {
      // listener.src = process.env.BASE_IMAGE_PATH + listener.src
    }
  }
})
Vue.prototype.GLOBAL = global // 全局配置
Vue.prototype.UTILS = utils // 全局公共工具类
Vue.prototype.VALIDATE = validate // 全局验证工具类
Vue.config.productionTip = false

// 处理移动端click事件300毫秒延迟
FastClick.attach(document.body)

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
